|
keypad library
v1.1.6
Matrix Keypad Library
|
Scans matrix keypad and returns a unique value for each key that is pressed. For an example circuit and program, go to learn.parallax.com and look for a keypad example in the Simple Devices series. More...
#include "simpletools.h"Go to the source code of this file.
Functions | |
| void | keypad_setup (int rowCount, int columnCount, int *rowPinCons, int *columnPinCons, int *buttonValues) |
| Set up the row and column dimensions, pins, and key values. | |
| int | keypad_read (void) |
| Returns the first key pressed, or -1 if no key is pressed. | |
| int | keypad_getNumber (void) |
| Get a number from the keypad. The number will be retured as soon as a non-numeric key is pressed and released. | |
| int | keypad_getNumberEndKey (void) |
| Get the key that terminated number received by keypad_getNumber. | |
| int | keypad_readFrom (int button) |
| If more than one key might be pressed and held at one time, use this keyapd_readFrom function to get the 2nd, 3rd, etc key. | |
Scans matrix keypad and returns a unique value for each key that is pressed. For an example circuit and program, go to learn.parallax.com and look for a keypad example in the Simple Devices series.
| int keypad_getNumber | ( | void | ) |
Get a number from the keypad. The number will be retured as soon as a non-numeric key is pressed and released.
| int keypad_getNumberEndKey | ( | void | ) |
Get the key that terminated number received by keypad_getNumber.
| int keypad_read | ( | void | ) |
Returns the first key pressed, or -1 if no key is pressed.
| int keypad_readFrom | ( | int | button | ) |
If more than one key might be pressed and held at one time, use this keyapd_readFrom function to get the 2nd, 3rd, etc key.
| button | Pass the value last returned by either keypad_read or keypad_readFrom. This function will start searching from one past that key in the scan order. |
| void keypad_setup | ( | int | rowCount, |
| int | columnCount, | ||
| int * | rowPinCons, | ||
| int * | columnPinCons, | ||
| int * | buttonValues | ||
| ) |
Set up the row and column dimensions, pins, and key values.
| rowCount | Number of keypad rows. |
| columnCount | Number of keypad columns. |
| *rowPinCons | Array that stores the row connections (from top to bottom). |
| *columnPinCons | Array that stores the column connections (from left to right). |
| *buttonValues | Array that stores the values that should be returned for each key. |
1.8.1.2